﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ArtOfTest.WebAii.Controls.HtmlControls;

namespace SM2ReportsData
{
    public class GenerateReportActions
    {
        public static void ClikOnButton(string strBtnName)
        {
            Utilities.GlobalObject.MANAGER.ActiveBrowser.RefreshDomTree();
            HtmlDiv UpdatePanel1 = Utilities.GlobalObject.MANAGER.ActiveBrowser.Find.ById<HtmlDiv>("UpdatePanel1");
            IList<HtmlInputSubmit> iListSubmit = UpdatePanel1.Find.AllByAttributes<HtmlInputSubmit>();

            for (int i = 0; i < iListSubmit.Count; i++)
            {
                HtmlInputSubmit btn = iListSubmit[i];
                string strLabelButton = btn.Value;
                if (strLabelButton != null && strLabelButton.Equals(strBtnName))
                {
                    SM2Input.Tradition.ClickButton(btn);
                    System.Threading.Thread.Sleep(Utilities.GlobalConfig.INT_WAIT_TIMEOUT_MILISECOND);
                    break;
                }
            }
        }
    }
}
